package com.tjetc.controller;

import com.tjetc.entity.CommandQuery;
import com.tjetc.entity.Comments;
import com.tjetc.service.CommentsService;
import com.tjetc.util.R;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.relational.core.sql.In;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 鞋评论表(Comments)表控制层
 *
 * @author makejava
 * @since 2025-09-15 14:10:30
 */
@RestController
@RequestMapping("comments")
public class CommentsController {
    /**
     * 服务对象
     */

    @Resource
    private CommentsService commentsService;

    @PostMapping("/page")
    public R queryPage(@RequestBody CommandQuery commandQuery){
        return R.ok(this.commentsService.queryByPage(commandQuery));
    }

    @GetMapping("/update")
    public R updateIsDeleteById(Integer cid, Integer isDelete){
        this.commentsService.updateIsDeleteById(cid,isDelete);
        return R.ok();
    }
}

